package com.dundun.SSO.manage.impl;

import com.dundun.SSO.core.impl.BaseServiceImpl;
import com.dundun.SSO.manage.ISsoGroupPermissionRelationService;
import com.dundun.SSO.manage.dao.SsoGroupPermissionRelationDao;
import com.dundun.SSO.manage.pojo.SsoGroupPermissionRelation;
import com.dundun.SSO.manage.query.SsoGroupPermissionRelationQuery;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import tk.mybatis.mapper.entity.Example;

import java.util.List;

/**********************************************************
 * 版权所有：搜影科技 保留所有权利
 * 创建日期: 2017/5/6 0006 10:37
 * 创建作者: gezhangkai
 * 版    本:
 * 功    能:
 * 最后修改时间:
 * 修改记录:
 ***********************************************************/
@Service
public class SsoGroupPermissionRelationServiceImpl extends BaseServiceImpl<SsoGroupPermissionRelation> implements ISsoGroupPermissionRelationService {
    @Autowired
    private SsoGroupPermissionRelationDao ssoGroupRightRelationDao;

    public List<SsoGroupPermissionRelation> selectByPage(SsoGroupPermissionRelationQuery ssoGroupRightRelationQuery) {
        return ssoGroupRightRelationDao.selectByPage(ssoGroupRightRelationQuery);
    }

    public Integer selectCountByPage(SsoGroupPermissionRelationQuery ssoGroupRightRelationQuery) {
        return ssoGroupRightRelationDao.selectCountByPage(ssoGroupRightRelationQuery);
    }

    @Override
    public List<SsoGroupPermissionRelation> selectAllPermissionRelationByGroupId(Long id) {
        Example example = new Example(SsoGroupPermissionRelation.class);
        Example.Criteria criteria = example.createCriteria();
        criteria.andEqualTo("groupId",id);
        return selectByExample(example);
    }
}
